package com.laopan.wxpay.request.prepay;

import com.laopan.wxpay.WxConstants;
import com.laopan.wxpay.bean.prepay.NativePrepayResult;
import com.laopan.wxpay.bean.prepay.PrepayOrder;
import com.laopan.wxpay.config.WxPayConfig;
import com.laopan.wxpay.exception.WxPayException;
import com.laopan.wxpay.request.WxPayRequest;

/**
 * @author laopan
 * @className NativePrepay
 * @date 2021/4/22 10:43
 */

public class NativePrepay extends WxPayRequest<PrepayOrder, NativePrepayResult> implements
        Prepay<PrepayOrder, NativePrepayResult> {

    public NativePrepay(WxPayConfig wxPayConfig) {
        super(wxPayConfig);
    }

    @Override
    protected Class<NativePrepayResult> getResultClass() {
        return NativePrepayResult.class;
    }

    @Override
    public NativePrepayResult prepay(PrepayOrder prepayOrder) throws WxPayException {
        return post(WxConstants.NATIVE_PAY_PATH, prepayOrder);
    }
}
